import request from '@/utils/request'

export function getMemberList(params) {
  return request({
    url: '/party-member/list',
    method: 'get',
    params
  })
}

export function getMemberDetail(id) {
  return request({
    url: `/party-member/${id}`,
    method: 'get'
  })
}

export function addMember(data) {
  return request({
    url: '/party-member/add',
    method: 'post',
    data
  })
}

export function updateMember(data) {
  return request({
    url: `/party-member/${data.id}`,
    method: 'put',
    data
  })
}

export function deleteMember(id) {
  return request({
    url: `/party-member/${id}`,
    method: 'delete'
  })
}

export function importMembers(file) {
  const formData = new FormData()
  formData.append('file', file)
  return request({
    url: '/party-member/import',
    method: 'post',
    data: formData,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}

export function exportMembers(params) {
  return request({
    url: '/party-member/export',
    method: 'get',
    params,
    responseType: 'blob'
  })
} 